﻿using System;
using System.Configuration;

namespace Config
{
    public class ConfigManager
    {
        //static readonly string sDbConnectionStringKey = "dbConnectionString";

        //public static string DbConnectionString
        //{
        //    get
        //    {
        //        string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings[sDbConnectionStringKey].ConnectionString;
        //        return connectionString;
        //    }
        //}

        //public static string DbProvider
        //{
        //    get
        //    {
        //        string provider = System.Configuration.ConfigurationManager.ConnectionStrings[sDbConnectionStringKey].ProviderName;

        //        return provider;
        //    }
        //}      

        public static string GetDbConnectionString(string connectionStringKey)
        {
            string result = System.Configuration.ConfigurationManager.ConnectionStrings[connectionStringKey].ConnectionString;
            return result;
        }

        public static string GetProviderName(string providerNameKey)
        {
            string result = System.Configuration.ConfigurationManager.ConnectionStrings[providerNameKey].ProviderName;
            return result;
        }

        public static string GetFileDirectory(string fileDirectoryKey)
        {
            string result = System.Configuration.ConfigurationManager.AppSettings[fileDirectoryKey];
            return result;
        }   

    }
}
